package cn.wolfcode.luowowo.acticle.service.impl;

import cn.wolfcode.luowowo.acticle.domain.CityScenic;
import cn.wolfcode.luowowo.acticle.mapper.CityScenicMapper;
import cn.wolfcode.luowowo.acticle.query.CityScenicQueryObject;
import cn.wolfcode.luowowo.acticle.service.ICityScenicService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class CityScenicServiceImpl implements ICityScenicService {

    @Autowired
    private  CityScenicMapper cityScenicMapper;

    public PageInfo query(CityScenicQueryObject qo) {

        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());
        List <CityScenic> list = cityScenicMapper.selectForList(qo);
        return new PageInfo(list);
    }

    public List<CityScenic> queryByHot() {
        List<CityScenic> hots = cityScenicMapper.selectByHot();
        return hots;
    }

    public CityScenic queryById(long id) {
        return cityScenicMapper.selectByPrimaryKey(id);
    }

    public List<CityScenic> queryAll() {
        List<CityScenic> all = cityScenicMapper.selectAll();
        return all ;
    }


}
